package com.guochuang.yunwang.promanager.serviceImpl;

import com.guochuang.yunwang.promanager.dao.GroupMapper;
import com.guochuang.yunwang.promanager.domain.Group;
import com.guochuang.yunwang.promanager.domain.dto.group.GroupDTO;
import com.guochuang.yunwang.promanager.domain.vo.group.GroupSearchVO;
import com.guochuang.yunwang.promanager.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GroupServiceImpl implements GroupService {
    @Autowired
    private GroupMapper groupMapper;

    @Override
    public Integer addNewGroup(Group group) {
        return groupMapper.addNewGroup(group);
    }

    @Override
    public Integer deleteGroupById(Integer gid) {
        return groupMapper.deleteGroupById(gid);
    }

    @Override
    public Integer deleteGroupByIds(List<Integer> gids) {
        return groupMapper.deleteGroupByIds(gids);
    }

    @Override
    public Integer deleteGroupsByNames(List<String> names){
        return groupMapper.deleteGroupsByNames(names);
    }

    @Override
    public Integer deleteGroupByName(String name){
        return groupMapper.deleteGroupByName(name);
    }

    @Override
    public Group getGroupById(Integer gid){
        return groupMapper.getGroupById(gid);
    }

    @Override
    public Group getGroupByName(String name){
        return groupMapper.getGroupByName(name);
    }

    @Override
    public List<Group> getAllGroups(){
        return groupMapper.getAllGroups();
    }

    @Override
    public Integer updateGroup(Group group) {
        return groupMapper.updateGroup(group);
    }

    @Override
    public List<GroupDTO> getAllGroupDTOs(){
        return groupMapper.getAllGroupDTOs();
    }

    @Override
    public List<GroupDTO> getAllGroupDTOsLike(GroupSearchVO group){
        return groupMapper.getAllGroupDTOsLike(group);
    }

    @Override
    public List<String> getAllUserNames(){
        return groupMapper.getAllUserNames();
    }
}
